package com.spider.silence.job;

import com.spider.silence.downloader.QZoneDownLoader;
import com.spider.silence.pool.QZoneDownLoaderPool;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.StatefulJob;

/**
 * @author 夏茂轩
 * @package com.spider.silence.job
 * @Date 2017/1/11 14:48
 * @description QQ空间定时采集Job
 */
public class QZoneJob implements StatefulJob {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        QZoneDownLoader downLoader =null;
        try {
            downLoader=QZoneDownLoaderPool.getInstance().fetchDownLoader();
            downLoader.generateTask();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            QZoneDownLoaderPool.getInstance().releaseDownLoader(downLoader);
        }
    }
}
